package javango.forms.fields;

import java.util.Map;

import com.google.inject.ImplementedBy;

@ImplementedBy(MultipleSelectField.class)
public interface MultipleChoiceField<T> extends Field<T[]> {
	
	/**
	 * Return a map of all available choices
	 * @return
	 */
	Map<T,String> getChoices();
	
	/**
	 * Set the map of available choices
	 * @param choices
	 * @return
	 */
	MultipleChoiceField<T> setChoices(Map<T,String> choices);
	
	/**
	 * Return the total number of choices that will be returned by a call to getChoices,  example usage would be a widget
	 * that changes based on the number of choices (ie don't want to return 10k choices from a database.)
	 * @return
	 */
	long getChoiceCount();
	
	/**
	 * Returns the object associated with the specified key.   
	 * 
	 * @param key
	 * @return
	 */
	String get(String key);	
}
